/*
 * 矩阵转置v1.0（4分）
 */

#include <stdio.h>

int main() {
	setbuf(stdout, NULL);

	int n;

	printf("Input n:");
	scanf("%d",&n);

	printf("Input %d*%d matrix:\n",n,n);
	int matrix[n][n];
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			scanf("%d",&matrix[i][j]);
		}
	}

	printf("The transposed matrix is:\n");
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			printf("%4d",matrix[j][i]);
		}
		printf("\n");
	}

	return 0;
}
